package com.laoluo.erp.taobao;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.TimeGetRequest;
import com.taobao.api.response.TimeGetResponse;

public class CommonHelper {
	
	private static TaobaoClient client = new DefaultTaobaoClient(ClientConfiguration.TOP_URL, ClientConfiguration.APP_KEY, ClientConfiguration.APP_SECRET);
	
	public static Date getTaobaoTime() throws ApiException
	{
		TimeGetRequest request =new TimeGetRequest();
    	TimeGetResponse response = client.execute(request);
		return response.getTime();
	}
	
	public List<TimePeriod> splitTimePeriod(Date start,Date end,int hours){
		List<TimePeriod> list = new ArrayList<TimePeriod>();
		//start.
		return null;
	}
}
